package com.zzyl.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.zzyl.dto.LoginDto;
import com.zzyl.entity.User;
import com.zzyl.mapper.SysUserMapper;
import com.zzyl.service.LoginService;
import com.zzyl.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public UserVo login(LoginDto loginDto) {
        User user = BeanUtil.toBean(loginDto, User.class);
        UserVo userVo = sysUserMapper.login(user);
        return userVo;
    }
}

